package com.smart.buss.ctrl;


import com.smart.primary.common.redis.JedisUtils;

public class JobRun {

	/**
	 * 是否有机器在运行
	 * @return
	 */
	public static boolean putStartServer(String jobName) {
		 String r = JedisUtils.setnxString(jobName, jobName,3600);
		 if("1".equals(r)) {
			 return true;
		 }else if("0".equals(r)) {
			 return false;
		 }
		 return false;
	}
	/**
	 * 是否有机器在运行
	 * @return
	 */
	public static boolean hasStartServer(String jobName) {
		Object name = JedisUtils.getString(jobName);
		if(name != null) {
			return true;
		}
		return false;
	}
	/**
	 * 删除运行
	 * @return
	 */
	public static void delStartServer(String jobName) {
		JedisUtils.delString(jobName);
	}
	public static void main(String[] age) {
		String key = "class com.jeecg.dk.task.ReportDataTask";
		JedisUtils.delObject(key);
	}
}
